/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2025-03-04
 * Time: 22:00
 */
public class demo3 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            for (int i = 0; i < 3; i++) {
                System.out.println("hello thread");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println("t 线程结束");
        });

        t.start();

        t.join();
        System.out.println("main 线程结束");
    }
}
